x=[13.6,14.01,14.54,15.64,15.69;
11.50,13.00,15.15,15.30,15.02;
13.76,16.36,16.90,16.56,17.30;
12.41,12.70,13.96,14.04,13.46;
2.48,2.49,2.56,2.64,2.59;
85,85,90,100,105;
55,65,75,80,80;
65,70,75,85,90;
12.80,15.30,16.24,16.40,17.05;
15.30,18.40,18.75,17.95,19.30;
12.71,14.50,14.66,15.88,15.70;
14.78,15.54,16.03,16.87,17.82;
7.64,7.56,7.76,7.54,7.70;
120,125,130,140,140;
80,85,90,90,95;
4.2,4.42,4.1,4.06,3.99;
13.1,13.42,12.85,12.72,12.56];
for i=1:15
x(i,:)=x(i,:)/x(i,1); %标准化数据
end
for i=16:17
x(i,:)=x(i,1)./x(i,:); %标准化数据
end
data=x;
n=size(data,2); %求矩阵的列数，即观测时刻的个数
ck=data(1,:); %提出参考数列
bj=data(2:end,:); %提出比较数列
m2=size(bj,1); %求比较数列的个数
for j=1:m2
t(j,:)=bj(j,:)-ck;
end
mn=min(min(abs(t'))); %求最小差
mx=max(max(abs(t'))); %求最大差
rho=0.5; %分辨系数设置
ksi=(mn+rho*mx)./(abs(t)+rho*mx); %求关联系数
r=sum(ksi')/n %求关联度
[rs,rind]=sort(r,'descend') %对关联度进行排序